Allow SDK to be copied into a project (useful for dev)#366
Conversation
WalkthroughA new early check was added to the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant getSDKVersionPython
participant Filesystem
Caller->>getSDKVersionPython: Call with context
getSDKVersionPython->>Filesystem: Check if "agentuity" directory exists
alt Directory exists
getSDKVersionPython-->>Caller: Return "0.0.0-prerelease"
else Directory does not exist
getSDKVersionPython->>Filesystem: Read uv.lock file
getSDKVersionPython->>getSDKVersionPython: Parse and return version from lock file
getSDKVersionPython-->>Caller: Return parsed version
end
Possibly related PRs
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
internal/bundler/upgrade.go (1)
170-172: Consider usingsemver.MustParsefor consistency and add a comment for clarity.The logic correctly implements the PR objective to support copied SDK development. However, there are two minor improvements to consider:
Error handling consistency: This is the only place using
semver.NewVersioninstead ofsemver.MustParse(used elsewhere in the file). Since the version string is hardcoded and valid,MustParsewould be more consistent.Documentation: A brief comment explaining this development-specific check would help future maintainers understand the purpose.
+ // Check if SDK source is copied directly into project (development mode) if util.Exists(filepath.Join(ctx.ProjectDir, "agentuity")) { - return semver.NewVersion("0.0.0-prerelease") + return semver.MustParse("0.0.0-prerelease"), nil }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
internal/bundler/upgrade.go(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/bundler/upgrade.go (1)
internal/util/io.go (1)
Exists(14-19)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test CLI Upgrade Path (windows-latest)
🔇 Additional comments (1)
internal/bundler/upgrade.go (1)
170-172: LGTM! The implementation correctly supports the development use case.This change elegantly handles the scenario where developers copy the SDK source into their project. The early return with a prerelease version is appropriate and consistent with the existing prerelease handling logic in the
checkForBreakingChangesfunction (lines 227-229).
Summary by CodeRabbit